package tienmanh.gs.goldminer.manager;

import java.io.IOException;
import org.andengine.audio.music.Music;
import org.andengine.audio.music.MusicFactory;
import org.andengine.audio.sound.Sound;
import org.andengine.audio.sound.SoundFactory;
import org.andengine.engine.Engine;
import org.andengine.engine.camera.BoundCamera;
import org.andengine.engine.camera.ZoomCamera;
import org.andengine.opengl.font.Font;
import org.andengine.opengl.font.FontFactory;
import org.andengine.opengl.texture.ITexture;
import org.andengine.opengl.texture.TextureOptions;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.bitmap.AssetBitmapTexture;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.texture.region.ITiledTextureRegion;
import org.andengine.opengl.texture.region.TextureRegion;
import org.andengine.opengl.texture.region.TextureRegionFactory;
import org.andengine.opengl.texture.region.TiledTextureRegion;
import org.andengine.opengl.vbo.VertexBufferObjectManager;

import tienmanh.gs.goldminer.goldsoft.GameActivity;

public class ResourcesManager
{
	
	public Music musicBackground;
	  public Sound soundAddMoney;
	  public Sound soundEndLevel;
	  public Sound soundExplode;
	  public Sound soundGetMoney;
	  public Sound soundHighValue;
	  public Sound soundLowValue;
	  public Sound soundStartLevel;
	  public Sound soundThrowHook;
	  public Sound soundTickingClook;
	  
  private static final ResourcesManager INSTANCE = new ResourcesManager();
  public GameActivity activity;
  public BitmapTextureAtlas buildableTextureBackground;
  public BitmapTextureAtlas buildableTextureHook;
  public BitmapTextureAtlas buildableTextureLevelBackground;
  public BitmapTextureAtlas buildableTextureFrzzeScreen;
  public BitmapTextureAtlas buildableTextureMiner;
  public BitmapTextureAtlas TextureMouse1;
  public BitmapTextureAtlas TextureMouse2;
  public BitmapTextureAtlas TextureMouse3;
  public BitmapTextureAtlas TextureMouse4;
  public BitmapTextureAtlas TextureMouseBeat;
  
  public BitmapTextureAtlas TextureElecFish;
  public BitmapTextureAtlas TextureFish1;
  public BitmapTextureAtlas TextureFish2;
  public BitmapTextureAtlas TextureFish3;
  public BitmapTextureAtlas TextureFish4;
  public BitmapTextureAtlas TextureFish5;
  
  public BitmapTextureAtlas TextureBagLoad;
  public TiledTextureRegion TextureRegionBagLoad;
  
  public BitmapTextureAtlas TextureTime;
  public TiledTextureRegion ttrTime;
  
  public BitmapTextureAtlas buildableTextureShopBackground;
  public ZoomCamera camera;
  public Engine engine;
  public ITiledTextureRegion flash_logo_region;
  public Font font1;
  public Font font2;
  public BitmapTextureAtlas icon_TextureAtlas;
  public ITiledTextureRegion icon_region;
  public BitmapTextureAtlas map_TextureAtlas;
  public ITiledTextureRegion map_region;
  public ITiledTextureRegion mapicon_region;
  
  public BitmapTextureAtlas splashTextureAtlas;
  
  public BitmapTextureAtlas textureThunder;
  
  public BitmapTextureAtlas textureNgocTrai;
  public BitmapTextureAtlas textureBezel;
  public BitmapTextureAtlas textureBuy;
  public BitmapTextureAtlas textureChest;
  public BitmapTextureAtlas textureExplode;
  
  public BitmapTextureAtlas textureGold0;
  public BitmapTextureAtlas textureGold1;
  public BitmapTextureAtlas textureGold2;
  public BitmapTextureAtlas textureGold3;
  public BitmapTextureAtlas textureGold4;
  public BitmapTextureAtlas textureGold5;
  
  
  public BitmapTextureAtlas textureJewel0;
  public BitmapTextureAtlas textureJewel1;
  public BitmapTextureAtlas textureJewel2;
  public BitmapTextureAtlas textureNextLevel;
  public BitmapTextureAtlas textureArrown;
  public TextureRegion textureRegionBackground;
  public TiledTextureRegion textureRegionBezel;
  public TextureRegion textureRegionBuy;
  public TiledTextureRegion textureRegionChest;
  public static TiledTextureRegion textureRegionExplode;
  
  public TiledTextureRegion textureRegionGold0;
  public TiledTextureRegion textureRegionGold1;
  public TiledTextureRegion textureRegionGold2;
  public TiledTextureRegion textureRegionGold3;
  public TiledTextureRegion textureRegionGold4;
  public TiledTextureRegion textureRegionGold5;
  
  
  
  public TiledTextureRegion textureRegionJewel0;
  public TiledTextureRegion textureRegionJewel1;
  public TiledTextureRegion textureRegionJewel2;
  public TiledTextureRegion textureRegionThunder;
  public TiledTextureRegion textureRegionNgocTrai;
  public TextureRegion textureRegionLevelBackground;
  public TextureRegion textureRegionFrzzeScreen;
  public ITiledTextureRegion textureRegionNextLevel;
  public ITiledTextureRegion textureRegionArrown;
  public TiledTextureRegion textureRegionSeller;
  public TiledTextureRegion textureRegionPearl;
  public TiledTextureRegion textureRegionBarier;
  public TextureRegion textureRegionShopBackground;
  public TiledTextureRegion textureRegionShopDiamond;
  public TiledTextureRegion textureRegionShopStreng;
  public TiledTextureRegion textureRegionShopMine;
  public TiledTextureRegion textureRegionShopTime;
  public TiledTextureRegion textureRegionStone0;
  public TiledTextureRegion textureRegionStone01;
  public TiledTextureRegion textureRegionStone02;
  
  public TiledTextureRegion textureRegionStone1;
  public TiledTextureRegion textureRegionTNT;
  public BitmapTextureAtlas textureSeller;
  public BitmapTextureAtlas texturePearl;
  public BitmapTextureAtlas textureBarier;
//  public BitmapTextureAtlas textureSellerTwo;
  public BitmapTextureAtlas textureShopDiamond;
  public BitmapTextureAtlas textureShopDiamondSelect;
  public BitmapTextureAtlas textureShopStreng;
  public BitmapTextureAtlas textureShopStrengSelect;
  public BitmapTextureAtlas textureShopMine;
  public BitmapTextureAtlas textureShopMineSelect;
  public BitmapTextureAtlas textureShopTime;
  public BitmapTextureAtlas textureShopTimeSelect;
  
  public BitmapTextureAtlas textureStone0;
  public BitmapTextureAtlas textureStone01;
  public BitmapTextureAtlas textureStone02;
  public BitmapTextureAtlas textureStone1;
 
  
  
  public BitmapTextureAtlas textureTNT;
  public TiledTextureRegion ttrHook;
  public TiledTextureRegion ttrMiner;
  public TiledTextureRegion ttrMouse1;
  public TiledTextureRegion ttrMouse2;
  public TiledTextureRegion ttrMouse3;
  public TiledTextureRegion ttrMouse4;
  public TiledTextureRegion ttrMouseBeat;
  public TiledTextureRegion ttrElecFish;
  public TiledTextureRegion ttrFish1;
  public TiledTextureRegion ttrFish2;
  public TiledTextureRegion ttrFish3;
  public TiledTextureRegion ttrFish4;
  public TiledTextureRegion ttrFish5;
  public BitmapTextureAtlas usericon_TextureAtlas;
  public VertexBufferObjectManager vbom;

  public static ResourcesManager getInstance()
  {
    return INSTANCE;
  }

  private void loadGameAudio()
  {
    try
    {
      this.soundStartLevel = SoundFactory.createSoundFromAsset(this.activity.getSoundManager(), this.activity, "music/start_level.wav");
      this.soundAddMoney = SoundFactory.createSoundFromAsset(this.activity.getSoundManager(), this.activity, "music/add_money.wav");
      this.soundEndLevel = SoundFactory.createSoundFromAsset(this.activity.getSoundManager(), this.activity, "music/end_level.wav");
      this.soundGetMoney = SoundFactory.createSoundFromAsset(this.activity.getSoundManager(), this.activity, "music/get_money.wav");
      this.soundThrowHook = SoundFactory.createSoundFromAsset(this.activity.getSoundManager(), this.activity, "music/throw_hook.wav");
      this.soundTickingClook = SoundFactory.createSoundFromAsset(this.activity.getSoundManager(), this.activity, "music/ticking_clock.wav");
      this.soundHighValue = SoundFactory.createSoundFromAsset(this.activity.getSoundManager(), this.activity, "music/high_value_obj_catch.wav");
      this.soundLowValue = SoundFactory.createSoundFromAsset(this.activity.getSoundManager(), this.activity, "music/low_value_obj_catch.wav");
      this.musicBackground = MusicFactory.createMusicFromAsset(this.activity.getMusicManager(), this.activity, "music/music.wav");
      this.soundExplode = SoundFactory.createSoundFromAsset(this.activity.getSoundManager(), this.activity, "music/explode.wav");
      return;
    }
    catch (IOException localIOException)
    {
    }
  }

  private void loadGameFonts()
  {
    FontFactory.setAssetBasePath("font/");
    BitmapTextureAtlas localBitmapTextureAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
    this.font1 = FontFactory.createStrokeFromAsset(this.activity.getFontManager(), localBitmapTextureAtlas, this.activity.getAssets(), "UVNDaLat_R.ttf", 30.0F, true, -1, 2.0F, 0);
    this.font1.load();
    this.font2 = FontFactory.createStrokeFromAsset(this.activity.getFontManager(), localBitmapTextureAtlas, this.activity.getAssets(), "UVNDaLat_R.ttf", 60.0F, true, -1, 2.0F, 0);
    this.font2.load();
  }

  private void loadGameGraphics()
  {
    loadObjectGraphic();
    loadPlayGraphic();
    
  }
  
  public  BitmapTextureAtlas mSnowParticle;
  public TiledTextureRegion mSnowParticleRegion;
  
  private void loadObjectGraphic(){
	  	BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/object/");
	    
	    this.textureGold0 = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
	    this.textureRegionGold0 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureGold0, this.activity, "vangto.png", 0, 0, 1, 1);
	    this.textureGold0.load();
	    
	    this.textureGold1 = new BitmapTextureAtlas(this.activity.getTextureManager(), 64, 64, TextureOptions.BILINEAR);
	    this.textureRegionGold1 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureGold1, this.activity, "vangvua.png", 0, 0, 1, 1);
	    this.textureGold1.load();
	    
	    this.textureGold2 = new BitmapTextureAtlas(this.activity.getTextureManager(), 64, 64, TextureOptions.BILINEAR);
	    this.textureRegionGold2 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureGold2, this.activity, "vangnho.png", 0, 0, 1, 1);
	    this.textureGold2.load();
	    
	    this.textureGold3 = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
	    this.textureRegionGold3 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureGold3, this.activity, "vangthoto.png", 0, 0, 1, 1);
	    this.textureGold3.load();
	    
	    this.textureGold4 = new BitmapTextureAtlas(this.activity.getTextureManager(), 64, 64, TextureOptions.BILINEAR);
	    this.textureRegionGold4 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureGold4, this.activity, "vangthovua.png", 0, 0, 1, 1);
	    this.textureGold4.load();
	    
	    this.textureGold5 = new BitmapTextureAtlas(this.activity.getTextureManager(), 32, 64, TextureOptions.BILINEAR);
	    this.textureRegionGold5 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureGold5, this.activity, "vangtho.png", 0, 0, 1, 1);
	    this.textureGold5.load();
	    
	    
	    this.textureJewel0 = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 64, TextureOptions.BILINEAR);
	    this.textureRegionJewel0 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureJewel0, this.activity, "kimcuongnho.png", 0, 0, 4, 1);
	    this.textureJewel0.load();
	    
	    this.textureJewel1 = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 256, TextureOptions.BILINEAR);
	    this.textureRegionJewel1 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureJewel1, this.activity, "kimcuongto.png", 0, 0, 4, 1);
	    this.textureJewel1.load();
	    
	    this.textureJewel2 = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 256, TextureOptions.BILINEAR);
	    this.textureRegionJewel2 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureJewel2, this.activity, "kimcuongvua.png", 0, 0, 4, 1);
	    this.textureJewel2.load();
	    
//	    this.textureJewel0 = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 64, TextureOptions.BILINEAR);
//	    this.textureRegionJewel0 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureJewel0, this.activity, "kimcuongnho.png", 0, 0, 4, 1);
//	    this.textureJewel0.load();
	    
	    this.textureTNT = new BitmapTextureAtlas(this.activity.getTextureManager(), 2048, 256, TextureOptions.BILINEAR);
	    this.textureRegionTNT = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureTNT, this.activity, "tnt.png", 0, 0, 6, 1);
	    this.textureTNT.load();
	    
	    this.textureExplode = new BitmapTextureAtlas(this.activity.getTextureManager(), 2048, 256, TextureOptions.BILINEAR);
	    this.textureRegionExplode = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureExplode, this.activity, "no.png", 0, 0, 11, 1);
	    this.textureExplode.load();
	    
	    this.textureThunder = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 1024, TextureOptions.BILINEAR);
	    this.textureRegionThunder = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureThunder, this.activity, "thund.png", 0, 0, 4, 1);
	    this.textureThunder.load();
	    
	    this.textureStone0 = new BitmapTextureAtlas(this.activity.getTextureManager(), 64, 64, TextureOptions.BILINEAR);
	    this.textureRegionStone0 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureStone0, this.activity, "dato.png", 0, 0, 1, 1);
	    this.textureStone0.load();
	    
	    this.textureStone01 = new BitmapTextureAtlas(this.activity.getTextureManager(), 32, 32, TextureOptions.BILINEAR);
	    this.textureRegionStone01 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureStone01, this.activity, "davua.png", 0, 0, 1, 1);
	    this.textureStone01.load();
	    
	    this.textureStone02 = new BitmapTextureAtlas(this.activity.getTextureManager(), 32, 32, TextureOptions.BILINEAR);
	    this.textureRegionStone02 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureStone02, this.activity, "danho.png", 0, 0, 1, 1);
	    this.textureStone02.load();
	    
	    this.textureStone1 = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	    this.textureRegionStone1 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureStone1, this.activity, "dacung.png", 0, 0, 1, 1);
	    this.textureStone1.load();
	    
	    this.textureNgocTrai = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 256, TextureOptions.BILINEAR);
	    this.textureRegionNgocTrai = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureNgocTrai, this.activity, "so.png", 0, 0, 4, 1);
	    this.textureNgocTrai.load();
	    
	    
	    this.buildableTextureMiner = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	    this.ttrMiner = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.buildableTextureMiner, this.activity, "onggia.png", 0, 0, 2, 4);
	    this.buildableTextureMiner.load();
	    
	    this.buildableTextureHook = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 128, TextureOptions.BILINEAR);
	    this.ttrHook = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.buildableTextureHook, this.activity, "ngoam.png", 0, 0, 2, 1);
	    this.buildableTextureHook.load();
	    
	    this.textureChest = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
	    this.textureRegionChest = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureChest, this.activity, "tui.png", 0, 0, 1, 1);
	    this.textureChest.load();
	    
	    this.TextureMouse1 = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	    this.ttrMouse1 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureMouse1, this.activity, "chuot1.png", 0, 0, 2, 2);
	    this.TextureMouse1.load();
	    
	    this.TextureMouse2 = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	    this.ttrMouse2 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureMouse2, this.activity, "chuot2.png", 0, 0, 2, 2);
	    this.TextureMouse2.load();
	    
	    this.TextureMouse3 = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	    this.ttrMouse3 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureMouse3, this.activity, "chuot3.png", 0, 0, 2, 2);
	    this.TextureMouse3.load();
	    
	    this.TextureMouse4 = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	    this.ttrMouse4 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureMouse4, this.activity, "chuot4.png", 0, 0, 2, 2);
	    this.TextureMouse4.load();
	    
	    this.TextureMouseBeat = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 512, TextureOptions.BILINEAR);
	    this.ttrMouseBeat = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureMouseBeat, this.activity, "chuotquai.png", 0, 0, 3, 2);
	    this.TextureMouseBeat.load();
	    
	    this.TextureElecFish = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	    this.ttrElecFish = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureElecFish, this.activity, "cadien.png", 0, 0, 2, 2);
	    this.TextureElecFish.load();
	    
	    this.TextureFish1 = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	    this.ttrFish1 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureFish1, this.activity, "cathuong.png", 0, 0, 2, 2);
	    this.TextureFish1.load();
	    
	    this.TextureFish2 = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	    this.ttrFish2 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureFish2, this.activity, "cavang.png", 0, 0, 2, 2);
	    this.TextureFish2.load();
	    
	    this.TextureFish3 = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 128, TextureOptions.BILINEAR);
	    this.ttrFish3 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureFish3, this.activity, "cua2.png", 0, 0, 2, 1);
	    this.TextureFish3.load();
	    
	    this.TextureFish4 = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 128, TextureOptions.BILINEAR);
	    this.ttrFish4 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureFish4, this.activity, "cua1.png", 0, 0, 2, 1);
	    this.TextureFish4.load();
	    
	    this.TextureFish5 = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	    this.ttrFish5 = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureFish5, this.activity, "ocmuonhon.png", 0, 0, 2, 1);
	    this.TextureFish5.load();
	    
	    this.TextureTime = new BitmapTextureAtlas(this.activity.getTextureManager(), 64, 64, TextureOptions.BILINEAR);
	    this.ttrTime = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureTime, this.activity, "time.png", 0, 0, 1, 1);
	    this.TextureTime.load();
	    
	    this.texturePearl = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 128, TextureOptions.BILINEAR);
	    this.textureRegionPearl = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.texturePearl, this.activity, "ngoc.png", 0, 0, 2, 1);
	    this.texturePearl.load();
	    
	    this.textureBarier = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 32, TextureOptions.BILINEAR);
	    this.textureRegionBarier = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureBarier, this.activity, "barrier.png", 0, 0, 1, 1);
	    this.textureBarier.load();
	    
	    this.mSnowParticle = new BitmapTextureAtlas(this.activity.getTextureManager(), 64, 64, TextureOptions.BILINEAR);
	    this.mSnowParticleRegion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.mSnowParticle, this.activity, "lacay.png", 0, 0, 1, 1);
	    this.mSnowParticle.load();
		
  }
  
  public BitmapTextureAtlas textureItemTNT;
  public BitmapTextureAtlas textureItemICE;
  public BitmapTextureAtlas textureItemMINE;
  public BitmapTextureAtlas textureItemCLOCK;
  public BitmapTextureAtlas textureBAG;
  
  public TiledTextureRegion textureRegionItemTNT;
  public TiledTextureRegion textureRegionItemICE;
  public TiledTextureRegion textureRegionItemMINE;
  public TiledTextureRegion textureRegionItemCLOCK;
  public TiledTextureRegion textureRegionBAG;
  
  private void loadPlayGraphic(){
	  BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/play/");
	  
	  this.textureItemTNT = new BitmapTextureAtlas(this.activity.getTextureManager(), 64, 128, TextureOptions.BILINEAR);
	  this.textureRegionItemTNT = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureItemTNT, this.activity, "bom.png", 0, 0, 1, 1);
	  this.textureItemTNT.load();
	  
	  this.textureItemICE = new BitmapTextureAtlas(this.activity.getTextureManager(), 64, 128, TextureOptions.BILINEAR);
	  this.textureRegionItemICE = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureItemICE, this.activity, "ice.png", 0, 0, 1, 1);
	  this.textureItemICE.load();
	  
	  this.textureItemMINE = new BitmapTextureAtlas(this.activity.getTextureManager(), 64, 128, TextureOptions.BILINEAR);
	  this.textureRegionItemMINE = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureItemMINE, this.activity, "tangluc.png", 0, 0, 1, 1);
	  this.textureItemMINE.load();
	  
	  this.textureItemCLOCK = new BitmapTextureAtlas(this.activity.getTextureManager(), 64, 128, TextureOptions.BILINEAR);
	  this.textureRegionItemCLOCK = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureItemCLOCK, this.activity, "clock.png", 0, 0, 1, 1);
	  this.textureItemCLOCK.load();
	  
	  this.textureBAG = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 128, TextureOptions.BILINEAR);
	  this.textureRegionBAG = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureBAG, this.activity, "diem.png", 0, 0, 1, 1);
	  this.textureBAG.load();  
	  
	  this.TextureBagLoad = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 128, TextureOptions.BILINEAR);
	  this.TextureRegionBagLoad = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.TextureBagLoad, this.activity, "endgame.png", 0, 0, 3, 1);
	  this.TextureBagLoad.load();
	  
	    this.buildableTextureBackground = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
	    this.textureRegionBackground = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.buildableTextureBackground, this.activity, "caonguyenBg.png", 0, 0);
	    this.buildableTextureBackground.load();


	    this.buildableTextureLevelBackground = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
	    this.textureRegionLevelBackground = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.buildableTextureLevelBackground, this.activity, "level_background.png", 0, 0);
	    this.buildableTextureLevelBackground.load();
	    
	    this.buildableTextureFrzzeScreen= new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
	    this.textureRegionFrzzeScreen = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.buildableTextureFrzzeScreen, this.activity, "bang.png", 0, 0);
	    this.buildableTextureFrzzeScreen.load();
	    
	  
  }

  private void loadMenuAudio()
  {
  }

  private void loadMenuFonts()
  {
	  
  }
  
  public BitmapTextureAtlas texturePlay;
  public BitmapTextureAtlas textureMore;
  public BitmapTextureAtlas textureInfor;
  public BitmapTextureAtlas textureVolume;
  public TiledTextureRegion textureRegionPlay;
  public TiledTextureRegion textureRegionMore;
  public TiledTextureRegion textureRegionInfor;
  public TiledTextureRegion textureRegionVolume;
  
  public BitmapTextureAtlas buildableTextureMenuBackground;
  public TextureRegion textureRegionMenuBackground;

  private void loadMenuGraphics()
  {
	  BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
	  
	  this.texturePlay = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 128, TextureOptions.BILINEAR);
	  this.textureRegionPlay = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.texturePlay, this.activity, "btnChoi.png", 0, 0, 1, 1);
	  this.texturePlay.load();
	  
	  this.textureMore = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
	  this.textureRegionMore = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureMore, this.activity, "btnGamekhac.png", 0, 0, 1, 1);
	  this.textureMore.load();
	  
	  this.textureInfor = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
	  this.textureRegionInfor = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureInfor, this.activity, "btnThongtin.png", 0, 0, 1, 1);
	  this.textureInfor.load();
	  
	  this.textureVolume = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
	  this.textureRegionVolume = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureVolume, this.activity, "btnSoundOn.png", 0, 0, 1, 1);
	  this.textureVolume.load();
	  
	  this.buildableTextureMenuBackground = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
	  this.textureRegionMenuBackground = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.buildableTextureMenuBackground, this.activity, "menuBg.png", 0, 0);
	  this.buildableTextureMenuBackground.load();
	  
  }

  public static void prepareManager(Engine paramEngine, GameActivity paramGameActivity, ZoomCamera paramZoomCamera, VertexBufferObjectManager paramVertexBufferObjectManager)
  {
    getInstance().engine = paramEngine;
    getInstance().activity = paramGameActivity;
    getInstance().camera = paramZoomCamera;
    getInstance().vbom = paramVertexBufferObjectManager;
  }


  public void loadGameResources()
  {
    loadGameGraphics();
    loadGameFonts();
    loadGameAudio();
  }

  public void loadHelpResource()
  {
	  
  }
  
  public BitmapTextureAtlas khobauTextureAtlas;
  public ITiledTextureRegion khobauregion;
  
  public BitmapTextureAtlas starTextureAtlas;
  public ITiledTextureRegion starregion;
  
  public BitmapTextureAtlas valueTextureAtlas;
  public ITiledTextureRegion valueregion;
  
  public BitmapTextureAtlas shopTextureAtlas;
  public ITiledTextureRegion shopregion;

  public void loadMapResource()
  {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/map/");
    this.map_TextureAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 2048, 2048);
    this.map_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.map_TextureAtlas, this.activity, "mapBg.png", 0, 0, 1, 1);
    this.map_TextureAtlas.load();
    
    this.usericon_TextureAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128);
    this.mapicon_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.usericon_TextureAtlas, this.activity, "char_icon.png", 0, 0, 1, 1);
    this.usericon_TextureAtlas.load();
    
    this.icon_TextureAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128);
    this.icon_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.icon_TextureAtlas, this.activity, "map icon.png", 0, 0, 2, 1);
    this.icon_TextureAtlas.load();
    
    this.valueTextureAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 256);
    this.valueregion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.valueTextureAtlas, this.activity, "diem.png", 0, 0, 1, 1);
    this.valueTextureAtlas.load();
    
    this.khobauTextureAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 256);
    this.khobauregion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.khobauTextureAtlas, this.activity, "cuadacbiet2.png", 0, 0, 1, 1);
    this.khobauTextureAtlas.load();
    
    this.starTextureAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 64);
    this.starregion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.starTextureAtlas, this.activity, "star.png", 0, 0, 3, 1);
    this.starTextureAtlas.load();
    
    this.shopTextureAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 256);
    this.shopregion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.shopTextureAtlas, this.activity, "shop.png", 0, 0, 1, 1);
    this.shopTextureAtlas.load();
  }

  public void loadMenuResources()
  {
    loadMenuGraphics();
    loadMenuAudio();
    loadMenuFonts();
  }

  public void loadMenuTextures()
  {
  }

  public void loadShopGraphics()
  {
	  BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/shop/");
	  
	  this.textureShopTime = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	  this.textureRegionShopTime = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureShopTime, this.activity, "dongho.png", 0, 0,1,1);
	  this.textureShopTime.load();
	  
	  this.textureShopStreng = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	  this.textureRegionShopStreng = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureShopStreng, this.activity, "tangluc.png", 0, 0,1,1);
	  this.textureShopStreng.load();
	  
	  this.textureShopMine = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	  this.textureRegionShopMine = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureShopMine, this.activity, "bom.png", 0, 0,1,1);
	  this.textureShopMine.load();
	  
	  this.textureShopDiamond = new BitmapTextureAtlas(this.activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
	  this.textureRegionShopDiamond = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureShopDiamond, this.activity, "bang.png", 0, 0,1,1);
	  this.textureShopDiamond.load();
	  
	  this.textureBuy = new BitmapTextureAtlas(this.activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
	  this.textureRegionBuy = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.textureBuy, this.activity, "btnMua.png", 0, 0);
	  this.textureBuy.load();
	  
	  this.textureNextLevel = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
	  this.textureRegionNextLevel = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureNextLevel, this.activity, "btnBack.png", 0, 0,1,1);
	  this.textureNextLevel.load();
	  
	  this.textureArrown = new BitmapTextureAtlas(this.activity.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
	  this.textureRegionArrown = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.textureArrown, this.activity, "down-arrow-red.png", 0, 0,1,1);
	  this.textureArrown.load();
	  
	  this.buildableTextureShopBackground = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
	  this.textureRegionShopBackground = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.buildableTextureShopBackground, this.activity, "shopBg.png", 0, 0);
	  this.buildableTextureShopBackground.load();
  }

  public void loadShopResources()
  {
    loadShopGraphics();
    loadShopSound();
  }

  public void loadShopSound()
  {
  }

  public void loadSplashScreen()
  {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    this.splashTextureAtlas = new BitmapTextureAtlas(this.activity.getTextureManager(), 1024, 512, TextureOptions.BILINEAR);
    this.flash_logo_region = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.splashTextureAtlas, this.activity, "logo_company.png", 0, 0, 1, 1);
    this.splashTextureAtlas.load();
  }

  public void setVolumeEffect()
  {
  }

  public void unloadGameTextures()
  {
  }

  public void unloadMenuTextures()
  {
  }

  public void unloadSplashScreen()
  {
    this.splashTextureAtlas.unload();
  }
}
